import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  experimental: {
    turbo: {
      // 禁用Turbopack实验性功能以避免依赖问题
      enabled: false
    }
  },
  webpack: (config) => {
    // 解决字体资源加载问题
    config.module.rules.push({
      test: /\.(woff2|woff|eot|ttf|otf)$/i,
      type: 'asset/resource'
    });
    return config;
  },
  async rewrites() {
    return [
      {
        source: '/api/:path*',
        destination: 'http://localhost:8081/api/:path*'
      }
    ];
  }
};

export default nextConfig;
